package com.tianquan.client.loadBalan;

import com.tianquan.client.loadBalan.strategy.LoadBalancerEnum;
import com.tianquan.common.instance.ServiceInstance;

/**
 * @Author: tianquan
 * @date: 2024-11-04  11:42
 * @Description: 负载均衡客户端
 */

public abstract class LoadBalancerClient{

    private LoadBalancerEnum Type;

    public LoadBalancerClient() {
        // 默认轮询
        Type = LoadBalancerEnum.RoundRobin;
    }

    public abstract ServiceInstance choose(String serviceName);

    public LoadBalancerClient(LoadBalancerEnum type) {
        Type = type;
    }

    public LoadBalancerEnum getType() {
        return Type;
    }

}
